﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint.Administration;
using Microsoft.Practices.SharePoint.Common.Configuration;

namespace SPContrib.SPGuidance.Extensions
{
    /// <summary>
    /// Extensions for the SPFarm class
    /// </summary>
    public static class SPFarmExtensions
    {
        /// <summary>
        /// Retrieves the collection of settings for the SPFarm
        /// </summary>
        public static ISettingCollection Settings(this SPFarm instance)
        {
            IPropertyBag properties = instance.PropertiesBag();
            return new SPFarmSettingCollection(properties, instance);
        }

        private static IPropertyBag PropertiesBag(this SPFarm instance)
        {
            IPropertyBag properties = new SPFarmPropertyBag(instance);
            return properties;
        }
    }
}
